package demo;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import dao.TicketMapper;
import model.Ticket;
import model.TicketExample;



@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring/spring-config.xml")
public class MGBTest {
	
	private Log logger = LogFactory.getLog(getClass());
	
	
	@Autowired
	private TicketMapper dao;
	
	
	
	@Test
	public void testDao(){
	    TicketExample cond = new TicketExample();
	    cond.createCriteria().andCellphoneIsNotNull();
	    List<Ticket> selectByExample = dao.selectByExample(cond);
	    for (Ticket ticket : selectByExample) {
            System.out.println(ticket);
        }
	}
	

}
